function hfile = aft_Browse(hfile, varargin)
% AFT::Browse  - add variable to BVQXtool GUI
%
% FORMAT:       obj.Browse;
%
% No input/output fields.
%
% TYPES: DMR, FMR, GLM, HEAD, HDR, MSK, SRF, VDW, VMP, VMR, VTC
%
% Note: this function requires GUI being available (figure/uicontrol).
%       it further employs the BVQXtool class.

% Version:  v0.8a
% Build:    9102122
% Date:     Oct-21 2009, 10:21 PM CEST
% Author:   Jochen Weber, SCAN Unit, Columbia University, NYC, NY, USA
% URL/Info: http://wiki.brainvoyager.com/BVQXtools

% argument check
if nargin < 1 || ...
    numel(hfile) ~= 1
    error( ...
        'BVQXfile:BadArgument', ...
        'Invalid call to ''%s''.', ...
        mfilename ...
    );
end

% for certain files, do nothing
ft = aft_Filetype(hfile);
switch (lower(ft))
    case {'dmr', 'fmr', 'glm', 'head', 'hdr', 'msk', ...
          'srf', 'v16', 'vdw', 'vmp', 'vmr', 'vtc'}
        % simply pass control to BVQXtool
        try
            BVQXtool(0, 'openfile', hfile);
        catch
            rethrow(lasterror);
        end
end
